struct VIn
{
	float3 pos : POSITION;
	float2 uv : TEXCOORD0;
	float4 color : COLOR;
};

struct VOut
{
	float4 pos : POSITION;
	float2 uv : TEXCOORD0;
	float4 color : COLOR;
};

texture tex : SPRITE_TEXTURE;

sampler tex_sampler =
sampler_state
{
    Texture = <tex>;
//  MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};

VOut VS_SpriteBatch(VIn IN)
{
	VOut OUT;
	OUT.pos = float4(IN.pos, 1.0f);
	OUT.uv = IN.uv;
	OUT.color = IN.color;

	return OUT;
}

float4 PS_SpriteBatch(VOut IN) : COLOR
{
    return tex2D(tex_sampler, IN.uv) * IN.color;
}

technique t0
{
	pass p0
	{
		VertexShader = compile vs_2_0 VS_SpriteBatch();
		PixelShader = compile ps_2_0 PS_SpriteBatch();
		
		AlphaBlendEnable = true;
		SrcBlend = srcAlpha;
		DestBlend = invSrcAlpha;
		CullMode = None;
	}
}
